package com.st.service.impl;

import java.util.List;

import com.st.dao.IDeptDao;
import com.st.dao.impl.DeptDaoImpl;
import com.st.enity.Dept;
import com.st.service.IDeptService;

public class DeptServiceImpl implements IDeptService{
	private IDeptDao deptDao = new DeptDaoImpl();
	@Override
	public List<Dept> getAll() {
		return deptDao.selectAll();
	}
	@Override
	public List<Dept> search(String key) {
		return deptDao.selectByKey(key);
	}

	@Override
	public int modify(Dept dept, String oldpassword, String newpassword, String newpassword2) {
		return 0;
	}

	@Override
	public int update(Dept dept, int id) {
		System.out.println(dept);
		return deptDao.update(dept,id);
	}

	@Override
	public int add(Dept dept) {
		return deptDao.add(dept);
	}

	@Override
	public int remove(int id) {
		return deptDao.remove(id);
	}

}
